function resultArray = parseMLFitterative(filename)

% [a,b,c,d,e] = textread('results_vite_ident2.mlf','%s%s%n%n%s','whitespace',' \n','headerlines',1)

fid = fopen (filename,'r');
% read first element

curline = fgetl(fid); %MLF header
curline = fgetl(fid); %MLF header
curline = fgetl(fid); %MLF header
curline = fgetl(fid); %MLF header
resultArray = [];
count = 0;

while 1

    curline = fgetl(fid);
    if (curline == -1) break; end;%EOF
    [gallerPer] = strread(curline,'"C:/xm2vts/parm/sent/48/%s"\n'); % "C:/xm2vts/parm/sent/48/S000_4_3.rec"
    curline = fgetl(fid);
    [f,g,probe,score] = strread(curline,'%n %n %s %f\n'); % 0 49900000 S000_3 -11041.454102
    curline = fgetl(fid); % .

    if strcmp(probe, 'SENT') ~= 1
        probeID = sscanf(char(probe),'S%d_3');
        galID = sscanf(char(gallerPer),'S%d_3_4.rec');
        resultArray = [[probeID, galID, score]; resultArray];
    end
    
    count = count + 1
    if count == 250
        disp('wait');
    end
    
end

fclose (fid);